package utils;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

public class Permutator {
	
	private PrintWriter wr;
	
	public Permutator(int length,String filename) throws IOException{
		wr=new PrintWriter(new BufferedWriter(new FileWriter(filename)));
		//System.out.println("Permutator started");
		perm("",length);
		//System.out.println("Permutator finished");
		wr.close();
	}
	
	public void perm(String result,int length){
		if (length==0){
			wr.println(result);
		}else{
			perm(result+"a",length-1);
			perm(result+"u",length-1);
			perm(result+"g",length-1);
			perm(result+"c",length-1);
			
		}
	}
	
	
}
